<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加内容</title>
<load href="__PUBLIC__/css/bootstrap.min.css" />
<import type='css' file="css.main" />
<load href="__PUBLIC__/js/jquery-1.9.1.min.js" />
<load href="__PUBLIC__/js/jquery-ui.min.js" />
<import type='js' file="js.main" />
<import type='js' file="js.setshowflag" />
<import type='js' file="js.setshowflag" />
<import type='js' file="js.moment" />
<import type='js' file="js.daterangepicker" />
<script type="text/javascript">
$(function(){
	$('#pro_starttime').daterangepicker({ singleDatePicker: true }, function(start, end, label) {
		console.log(start.toISOString(), end.toISOString(), label);
	});
	var extstr = "{$ys.isc}";
	var arr = extstr.split(",");
	for(var i in arr){
		set_flag_v(arr[i]);
	}
	function set_flag_v(v){
		$("input.extendedattr").each(function(index, element) {
			var t = $(this);
			if(t.val()==v){
				t.attr("checked","checked");
			}
		});
	}
})
</script>
<style type="text/css">.hktinfo{display: none;}</style>
</head>

<body id="body">
<div class="main-frame">
	<div class="position">华人码 > 添加养生</div>
	<!-- 图片资源开始 -->
	<div class="floatBackground" id="floatBackground" style="display: none;">
		<div class="bounced">
		<label class="closeImgResurces">X</label>
		<iframe id="imgResourcesiframe" src="{:rtrim(U('Upload/index'),'.html')}" width="750" height="465" frameborder="0" scrolling="auto"></iframe>
		</div>
	</div>
	<!-- 图片资源结束 -->
	<div class="addobject">
		<div class="obj-form">
			<form name="form1" id="form1" action="{:U('Ysheng/edit')}" method="post" class="form-inline">
				<input type="hidden" name="hiddenid" value="{$ys.id}">
				<ul>
					<li class="lititle">
						<label class="fl tle">标题：</label>
						<span class="fl cnt">
						<input name="y_title" class="form-control" placeholder="标题" value="{$ys.y_title}" style="width: 450px;"><em>*</em>
						</span>
					</li>
					<li class="hktinfo">
						<label class="fl tle">职务：</label>
						<span class="fl cnt">
						<input name="y_zhiwu" class="form-control" placeholder="职务" value="{$ys.y_zhiwu}" style="width: 150px;"><em>*</em>
						</span>
					</li>
					<li class="hktinfo">
						<label class="fl tle">姓名：</label>
						<span class="fl cnt">
						<input name="y_pname" class="form-control" placeholder="姓名" value="{$ys.y_pname}" style="width: 150px;"><em>*</em>
						</span>
					</li>
					<li>
						<label class="fl tle">图片：</label>
						<span class="fl cnt"><input name="y_img" id="thumbimg" value="{$ys.y_img}" class="form-control" placeholder="图片地址" style="width: 450px;"><a class="browse" f='thumbimg'>浏览···</a></span>
					</li>
					<li>
						<label class="fl tle">扩展属性：</label>
						<span class="fl cnt">
							<input type="checkbox" value="1" name="isc[]" class="extendedattr"> 商城
							<input type="checkbox" value="2" name="isc[]" class="extendedattr"> 推荐
						</span>
					</li>
					<li>
						<label class="fl tle">外链地址：</label>
						<span class="fl cnt"><input name="y_link" value="{$ys.y_link}" class="form-control" placeholder="外链地址" style="width: 450px;"></span>
					</li>
					<li>
						<label class="fl tle">音频地址：</label>
						<span class="fl cnt">
						<input name="y_audiopath" class="form-control" placeholder="音频地址" value="{$ys.y_audiopath}" style="width: 450px;"><em>*</em>
						</span>
					</li>
					<li>
						<label class="fl tle">视频地址：</label>
						<span class="fl cnt">
						<textarea name="y_vurl" class="form-control" placeholder="视频地址" style="width: 450px; height:120px;">{$ys.y_vurl}</textarea>
						</span>
					</li>
					<li>
						<label class="fl tle">排序：</label>
						<span class="fl cnt"><input name="sn" value="{$ys.sn}" class="form-control" style="width: 100px;"></span><em style="color: #b3b3b3; padding-left: 6px;">数字越大越靠前</em>
					</li>
					<li>
						<label class="fl tle">所属分类：</label>
				    	<span class="fl cnt">
					    	<select name="type" class="form-control" style="width:200px;">
					    		<volist name='resourcelist' id='v'>
					    		<if condition="$v['pid'] eq 0">
					    			<option value="{$v.id}" <if condition="$v['id'] eq $ys['type']">selected="selected"</if>>{$v['typename']}</option>
					    			<volist name='resourcelist1' id='v1' key='j'>
					    			<if condition="$v1['pid'] eq $v['id']">
					    			<option value="{$v1.id}" <if condition="$v1['id'] eq $ys['type']">selected="selected"</if>>——{$v1['typename']}</option>
					    			</if>
					    			</volist>
					    		</if>
					    		</volist>		
					    	</select>
				    	</span>
					</li>
				    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/UEditor/ueditor.config.js"></script>
				    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/UEditor/ueditor.all.min.js"> </script>
				    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/UEditor/lang/zh-cn/zh-cn.js"></script>
					<li>
						<label class="fl tle">内容：</label>
						<span class="fl cnt">
							<textarea name="content" id="editor" style="width: 900px; height:300px; overflow: hidden;">{$ys.content}</textarea>
							<script>var ue = UE.getEditor('editor');</script>
						</span>
					</li>
					<li>
						<label class="fl tle">浏览量：</label>
						<span class="fl cnt"><input name="p_view" value='{$ys.p_view}' class="form-control" placeholder="浏览量" style="width: 100px;"></span>
					</li>
					<li>
						<label class="fl tle">&nbsp;</label>
						<span class="fl cnt">
                             	发布人：<input name="issuer" class="txtlength200" style="width: 100px; margin-right:15px;" placeholder="{$ys.issuer}" value='{$ys.issuer}' readonly="readonly">
                             	发布日期：<input name="y_datetime" class="txtlength200" style="width: 160px;" placeholder="发布日期" value="{:date('Y-m-d')}">
						</span>
					</li>
					<li class="error" style="display:none;">
						<label class="fl tle">&nbsp;</label>
						<span class="fl cnt"><font>错误：此处显示错误提示</font></span>
					</li>
					<li class="submit">
						<label class="fl tle">&nbsp;</label>
						<span class="fl cnt"><input type="submit" value="确定修改" class="submitbtn" /></span>
					</li>
				</ul>
			</form>
		</div>
		<div class="obj-previewimg">
			<div class="instructions">
				<b>备注说明：</b><br>
				1、带有红色  “ * ” 项必填<br>
			</div>
		</div>
	</div>

</div>
<script type="text/javascript">
	$(function(){
		function typeTootherinfo(){
			var typev = $("select[name='type']").val();
			if(typev==27 || typev==103){
				$("li.lititle").find("label").html('企业名称：');
				$("li.lititle").find("input").attr('placeholder','企业名称');
				$("li.hktinfo").show();
			}
		}
		window.onload = function(){
			typeTootherinfo();
		}
	})
</script>
</body>
</html>
